<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        #box{
            width: 200px;
            height: 200px;
        }
        
    </style>
    <script>
        window.onload = function () {
            console.log(`加载完毕!`);
        }
    </script>
</head>
<body>
    <div id="box"></div>
    <input type="button" value="我是一个按钮">
    <script>
        box.style.background = "red"
        box.onmousemove = function () {
            console.log("滑入");
        }

        var btn = document.querySelector("input")
        btn.style.position = "fixed"
        btn.style.right = "50px"
        btn.style.top = "50px"
        btn.onmousedown = function(){
            box.style.display = "none"
        }
        btn.onmouseup = function(){
            box.style.display = "block"
        }
        console.log(box.style.display);
    </script>
</body>
</html>